$(function(){
	var $modal2 = $('#my-actions');
//	var url = location.href;
//	var url_arr = url.split("?");
	$("#toleft").click(function(){
		location.href = "queryindex.html";
	});
	
	$("#menu").click(function(){
		location.href = "query_more.html";
	});
	
	$("#sendMessage2").click(function(){
		$modal2.modal();
	});
	
	$("#tuwen").click(function(){
		location.href = "dongtai_tuwen.html";
	});
	
	$("#yuyin").click(function(){
		location.href = "dongtai_yuyin.html";
	});
	
	var query_id = localStorage.getItem("query_id");
	console.log("store_id:" + query_id);

	var urlPath = "http://yx.fxtourong.com/V1/Circle/CircleDetails?"+"store_id=" + query_id;
	console.log("url:" + urlPath);
	$.ajax({
			type: "POST",
			url: urlPath,
			data: {
				token : localStorage.getItem("token")
			},
			dataType: "json",
			success: function(data) {
				console.log(data);
				var code = data.code;
				console.log(code);
				if(code == "1") {
					$("#myCircleName").text(data.data.name);
					$("#myName").text(data.data.nickname);
					var avatar = data.data.avatar;
					localStorage.setItem("query_personimage", avatar);
					localStorage.setItem("query_role", data.data.type);
					console.log("我的角色：" + localStorage.getItem("query_role"));
				}
			}
		});
		
	$("#sendMessage").click(function(){
//		location.href = "http://yx.fxtourong.com/V1/Goods/createtopic_view.html";
		location.href = "create_tp_first.html";
	});
		
});
